 layui.use(['form', 'button', 'popup', 'jquery'], function() {
			    var $ = layui.jquery;
				var form = layui.form;
				var button = layui.button;
				var popup = layui.popup;
                // 登 录 提 交
				form.on('submit(login)', function(data) {
					/// 验证
        			var admin_user = $("#admin_user").val();
        			var admin_pass = $("#admin_pass").val();
        			var code_input = $("#code_input").val();
        			var ii = layer.load(5, {
        				shade: [0.1, '#fff']
        			});
					button.load({
						elem: '.login',
						time: 1500,
						done: function() {
						}
					})
        			$.ajax({
        				type: "POST",
        				url: "/h/ajax/login",
        				data: {
        					"admin_user": admin_user,
        					"admin_pass": admin_pass,
        					"code_input":code_input
        				},
        				dataType: 'json',
        				timeout: 15000, //ajax请求超时时间15s
        				success: function(data) {
        					layer.close(ii);
        					if (data.code == 1) {
    							popup.success(data.msg);
        						setTimeout(function() {
        							location.href = "./index";
        						}, 1000); //延时1秒跳转
        					} else {
        					    popup.failure(data.msg);
        					    refreshCaptcha();
        				         // 刷新验证码
        					}
        				},
        				error: function(data) {
        					layer.close(ii);
        					popup.failure('服务器错误');
        				// 	refreshCaptcha();
        			      // 刷新验证码
        				}
        			});
					return false;
				});
			})
 